//
//  SHLabel.m
//  YHSJ
//
//  Created by CYF on 16/11/10.
//  Copyright © 2016年 SH. All rights reserved.
//

#import "SHLabel.h"

@implementation SHLabel

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
    }
    return self;
}
#pragma mark -- 设置label 字体 16进制颜色
- (void)setTextFont:(CGFloat )font textColorString:(NSString *)color{
    [self setTextFont:font textColor:[UIColor colorWithHexString:color]];
}

#pragma mark -- 设置label 字体 颜色
- (void)setTextFont:(CGFloat )font textColor:(UIColor *)color{
    [self setFont:KSHSystemFont(font)];
    [self setTextColor:color];
}
#pragma mark -- 设置label 圆角
- (void)setCornerRadius:(CGFloat)cornerRadius{
    self.layer.cornerRadius = __I6Width(cornerRadius);
    self.layer.masksToBounds = YES;
}
#pragma mark -- 设置label 边框宽度 边框颜色
- (void)setBorderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor{
    self.layer.borderWidth = borderWidth;
    self.layer.borderColor = borderColor.CGColor;
}
#pragma mark -- 创建label 
+ (SHLabel *)labelWithTextFont:(CGFloat )font textColorString:(NSString *)color textAlignment:(NSTextAlignment)textAlignment{
    
    SHLabel *label = [[SHLabel alloc]init];
    [label setTextFont:font textColorString:color];
    [label setTextAlignment:textAlignment];
    
    
    return label;
}
+ (SHLabel *)labelWithTextFont:(CGFloat )font textColor:(UIColor *)color textAlignment:(NSTextAlignment)textAlignment{
    
    SHLabel *label = [[SHLabel alloc]init];
    [label setTextFont:font textColor:color];
    [label setTextAlignment:textAlignment];
    
    
    return label;
}

+ (SHLabel *)labelWithText:(NSString *)text  font:(CGFloat )font textColor:(UIColor *)color textAlignment:(NSTextAlignment)textAlignment{
    
   SHLabel *label = [SHLabel labelWithTextFont:font textColor:color textAlignment:textAlignment];
    label.text = text;
    
    
    return label;
}
@end
